import React from 'react'
import {HashRouter as Router,Route,Switch,NavLink,Redirect} from 'react-router-dom'
import Home from './pages/home.jsx'
import About from './pages/about.jsx'
import Detail from './pages/detail.jsx'
import Query from './pages/query.jsx'
import State from './pages/state.jsx'
function App(){
	return (
		<div className="container">
			<Router>
				<NavLink to='/home' activeClassName='active'>首页</NavLink>
				<NavLink to='/about' activeClassName='active'>关于</NavLink>
				<Switch>
					<Route path='/home' component={Home} />
					<Route path='/about' component={About} />
					<Route path='/query' component={Query} />
					<Route path='/state' component={State} />
					<Route path='/detail/:id' component={Detail} />
					<Redirect to='/home' />
				</Switch>
			</Router>
		</div>
	)
}

export default App